<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<!--
  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.

  Use of this source code is governed by a BSD-style license
  that can be found in the LICENSE file in the root of the source
  tree. An additional intellectual property rights grant can be found
  in the file PATENTS.  All contributing project authors may
  be found in the AUTHORS file in the root of the source tree.
-->
<html>
<head>
  <title>WebRTC Fuzz Test Template</title>
  <script type="text/javascript">
  function requestVideo() {
    BEFORE_GET_USER_MEDIA_CALL
    navigator.webkitGetUserMedia(FUZZ_USER_MEDIA_INPUT,
                                 FUZZ_OK_CALLBACK,
                                 FUZZ_FAIL_CALLBACK);
    AFTER_GET_USER_MEDIA_CALL
  }

  function getUserMediaFailedCallback(error) {
    console.log('GetUserMedia call failed with code ' + error.code);
  }

  function getUserMediaOkCallback(stream) {
    var streamUrl = webkitURL.createObjectURL(stream);
    document.getElementById('view1').src = streamUrl;
    stream.stop()
  }
  </script>
</head>
<body onload="requestVideo();">
  <table border="0">
    <tr>
      <td>Local Preview</td>
    </tr>
    <tr>
      <td><video width="320" height="240" id="view1"
          autoplay="autoplay"></video></td>
    </tr>
  </table>
</body>
</html>